package com.demo.core.model.support;

/**
 * 改进前序遍历树模型（内嵌数据模型）
 * 
 * 该模型处理树形结构相对于邻接列表模型（The Adjacency List Model）的较优模型
 *
 * @author ryuu.kk
 * @param <PK>
 */
public class NestedSetModel extends AdjacencyListModel {
	
	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = 1787893778023100947L;
	/**
	 * 树的节点左值
	 */
	private Long left;
	/**
	 * 树的节点右值
	 */
	private Long right;
	
	public Long getLeft() {
		return left;
	}
	public void setLeft(Long left) {
		this.left = left;
	}
	public Long getRight() {
		return right;
	}
	public void setRight(Long right) {
		this.right = right;
	}
	
	@Override
	public int hashCode() {
		int code = super.hashCode();
        code ^= this.left == null ? 0 : this.left.hashCode();
        code ^= this.right == null ? 0 : this.right.hashCode();
        return code;
	}
}
